package cg.modelo;

public class MonsterCard extends Card implements Summoneable{

	private BattlePosition battlePosition;

	public MonsterCard(String id) {
		super(id);
	}

	@Override
	public boolean set(Board board) {
		if(!board.getMonsterZone().full()) {
			board.getMonsterZone().add(this);
			return true;
	}
		return false;
	}

	@Override
	public boolean summon(Board board, BattlePosition bp) {
		if(!board.getMonsterZone().full()) {
			this.setBattlePosition(bp);
			this.setVisibility(true);
			board.getMonsterZone().add(this);
			return true;
	}
		return false;
	}

	private void setBattlePosition(BattlePosition bp) {
		this.battlePosition = bp;	
	}
	
	public boolean sendToGraveyard(Board board) {
		if(board.getMonsterZone().hasCard(this)) {
			board.getMonsterZone().removeCard(this);
			board.getGraveyard().add(this);
			return true;
		}
		return false;
	}
	
	public boolean removeFromPlay(Board board) {
		if(board.getMonsterZone().hasCard(this)) {
			board.getMonsterZone().removeCard(this);
			board.getOutOfPlay().add(this);
			return true;
		}
		return false;
	}

}
